package execption;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AutoClosseableDemo {
    public static void main(String[] args) {
        System.out.println("开始");
        try (FileOutputStream fos=new FileOutputStream("fos.dat");){
            fos.write(1);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("ok");
    }
}
